import sqlite3

from select import select

#连接数据库
coon = sqlite3.connect("test.db")
#创建游标
cursor =coon.cursor()
#创建表
#cursor.execute("create table user(id integer(11) primary key,name varchar(20))")
#插入数据
sql="insert into user values(1,'root')"
sql2 ="insert into user values(?,?)"
#cursor.execute(sql2,(2,"admin"))
#coon.commit()

#查询数据
sql = "select * from user"
#cursor.execute(sql)
#for row in cursor:
    #打印用户名，row[0]代表第一列
#    print (row)
results = cursor.execute(sql).fetchall()
for row in results:
    print(row[1])